Up to count characters of s, starting at start (0-based) - taking part of a string.
string_slice(s, start, count) -> string| Name | Type |
|---|---|
s | string |
start | int |
count | int |
string
Up to count characters of s, starting at start (0-based) - taking part of a string.
start/count are clamped, never a crash: a start past the end (or negative) reads as "nothing left to take", and a count running past the end of s is shortened to whatever is actually there.
var call_sign = "FALCON-9";
var prefix = string_slice(call_sign, 0, 6);
var suffix = string_slice(call_sign, 7, 1);
var matches = prefix == "FALCON";The result can never be longer than s itself, so only your project's own Longest string setting can ever truncate it further - call string_length on the result if you need to confirm nothing was cut.
start/count are CLAMPED, never a crash: a start past the end (or negative) reads as "nothing left to take", and a count running past the end of s is quietly shortened to whatever is actually there. The result can never be longer than s itself, so only capacities.maxStringLength (this call's own {scap}) can ever truncate it further - see string_length on the result if you need to confirm nothing was cut.